<html>
<head>manager</head>
<body>

<div>
    <p>location</p>
    cityName:<br/>
    <input type="text" id="cityName" placeholder="cityName" value="广州"><br/>
    zoneName: <br/>
    <input type="text" id="zoneName" placeholder="zoneName" value="天河"><br/>
    <input type="submit" id="addLoc" value="add location">
    <input type="submit" id="allLoc" value="all location">
</div>


<div>
    <p>category</p>
    cateName:<br/>
    <input type="text" id="cateName" placeholder="cateName" value="cate1"><br/>
    <input type="submit" id="addCate" value="add category">
    <input type="submit" id="allCate" value="all category">
</div>

</body>
<script src="/js/jquery.js"></script>
<script src="/js/index.js"></script>
<script>
    $('#addLoc').on('click', function () {
        var cityName = $('#cityName').val();
        var zoneName = $('#zoneName').val();
        addLoc(cityName, zoneName, function (err, data) {
            if (err) return console.log('err ', err);
            console.log(data);
        });
    });

    $('#allLoc').on('click', function () {
        allLoc(function (err, data) {
            if (err) return console.log('err ', err);
            console.log(data);
        });
    });

    $('#addCate').on('click', function () {
        var cateName = $('#cateName').val();
        addCate(cateName, function (err, data) {
            if (err) return console.log('err ', err);
            console.log(data);
        });
    });

    $('#allCate').on('click', function () {
        allCate(function (err, data) {
            if (err) return console.log('err ', err);
            console.log(data);
        });
    });

</script>
</html>